Sys = {
    subscribes = {}
}

function Sys:subscribe(msg, callback)
    self.subscribes[msg] = callback
end

function Sys:publish(msg, ...)
    local arg = {...}
    if self.subscribes[msg] then
        coroutine.resume(coroutine.create(self.subscribes[msg]), table.unpack(arg))
    end
end
